/**
 * @Copyright (C) 2019 广州金鹏集团有限公司.
 * 本系统是商用软件,未经授权擅自复制或传播本程序的部分或全部将是非法的.
 * @创建人: 赵力
 * @创建时间: 2019-01-25 15:27
 * @版本: V1.0
 */
package com.ikcai.enginegraph.controller;

import com.ikcai.enginegraph.domain.node.Weapon;
import com.ikcai.enginegraph.service.IWeaponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @类功能说明: 武器控制类
 * @创建人: 赵力
 * @创建时间: 2019-01-25 15:27
 */
@RestController
@RequestMapping("/weapon")
public class WeaponController {

    @Autowired
    private IWeaponService service;

    @RequestMapping(path = "/addWeapon", method = RequestMethod.POST)
    public Weapon addWeapon(@RequestBody Weapon weapon) {

        return service.addWeapon(weapon);
    }

    @RequestMapping(path = "/addWeaponByName", method = RequestMethod.POST)
    public Weapon addWeaponByName(@RequestBody Weapon weapon) {

        return service.addWeaponByName(weapon.getName());
    }
    @RequestMapping(path = "/deleteWeaponById", method = RequestMethod.POST)
    public boolean deleteWeaponById(@RequestBody Long id) {
        return service.deleteWeaponById(id);
    }
}
